﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<PorteringManagement.Model.Itinerary>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Itinerarios
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Crear Nuevo Itinerario</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Itinerario</legend>

        <div class="editor-label">
            <%: Html.Label("analysisType", "Criterio de Análisis")%>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("analysisType", (IEnumerable<SelectListItem>)this.ViewBag.AnalysisTypes)%>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.DeparturePortID, "Puerto de Partida") %>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("DeparturePortID", (IEnumerable<SelectListItem>)this.ViewBag.PortID, string.Empty)%>
            <%: Html.ValidationMessageFor(model => model.DeparturePortID) %>
        </div>
        
        <div class="editor-label">
            <%: Html.LabelFor(model => model.DepartureTime, "Fecha de Partida") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.DepartureTime) %>
            <%: Html.ValidationMessageFor(model => model.DepartureTime) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.ArrivalPortID, "Puerto de Llegada")%>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("ArrivalPortID", (IEnumerable<SelectListItem>)this.ViewBag.PortID, string.Empty)%>
            <%: Html.ValidationMessageFor(model => model.ArrivalPortID) %>
        </div>
        
        <div class="editor-label">
            <%: Html.LabelFor(model => model.ArrivalTime, "Fecha de LLegada")%>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.ArrivalTime) %>
            <%: Html.ValidationMessageFor(model => model.ArrivalTime) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Name, "Nombre") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.Name) %>
            <%: Html.ValidationMessageFor(model => model.Name) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.Descripion, "Descripción") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.Descripion) %>
            <%: Html.ValidationMessageFor(model => model.Descripion) %>
        </div>

        <p>
            <input type="submit" value="Crear" />
        </p>
    </fieldset>
<% } %>

<div>
    <%: Html.ActionLink("Volver a la Lista", "Index") %>
</div>

</asp:Content>
